import { createRouter, createWebHashHistory } from "vue-router";
import beforePage from "@/views/BeforePage.vue";
import beforePageMobile from "@/views/BeforePageMobile.vue";

const router = createRouter({
  history: createWebHashHistory(),

  // 返回页面滚动行为
  scrollBehavior: () => {
    return {
      top: 0,
    };
  },
  routes: [
    // 封面
    {
      path: "/",
      component: beforePage,
    },

    //移动端封面
    {
      path: "/mobile",
      component: beforePageMobile,
    },
    // PC端主页
    {
      path: "/home",
      component: () => import("@/views/Home/Home.vue"),
    },

    // 移动端主页
    {
      path: "/homeMobile",
      component: () => import("@/views/Home/Home-Mobile.vue"),
    },


    // 404页面
    {
      path: "/404",
      component: () => import("@/views/404.vue"),
    },
    {
      path: "/:catchAll(.*)",
      redirect: "/404",
    },
  ],
});

export default router;
